__author__ = 'ipetrov'
from internal_page import InternalPage

class AddNewMoviePage(InternalPage):

    @property
    def title_field(self):
        return self.driver.find_element_by_name("name")

    @property
    def aka_field(self):
        return self.driver.find_element_by_name("aka")

    @property
    def year_field(self):
        return self.driver.find_element_by_name("year")

    @property
    def year_error(self):
        return self.driver.find_element_by_id('updateform').find_element_by_xpath(
                "./table/tbody/tr[4]/td[2]/label")

    @property
    def duration_field(self):
        return self.driver.find_element_by_name("duration")

    @property
    def rating_field(self):
        return self.driver.find_element_by_name("rating")

    @property
    def own_no_checkbox(self):
        return self.driver.find_element_by_id("own_no")

    @property
    def own_yes_checkbox(self):
        return self.driver.find_element_by_id("own_yes")

    @property
    def seen_no_checkbox(self):
        return self.driver.find_element_by_id("seen_no")

    @property
    def seen_yes_checkbox(self):
        return self.driver.find_element_by_id("seen_yes")

    @property
    def loaned_no_checkbox(self):
        return self.driver.find_element_by_id("loaned_no")

    @property
    def loaned_yes_checkbox(self):
        return self.driver.find_element_by_id("loaned_yes")

    @property
    def loanname_field(self):
        return self.driver.find_element_by_name("loanname")

    @property
    def trailer_url_button(self):
        return self.driver.find_element_by_css_selector("img[alt=\"Search for movie trailer\"]")

    @property
    def trailer_field(self):
        return self.driver.find_element_by_name("trailer")

    @property
    def notes_field(self):
        return self.driver.find_element_by_name("notes")

    @property
    def taglines_field(self):
        return self.driver.find_element_by_name("taglines")

    @property
    def plotoutline_field(self):
        return self.driver.find_element_by_name("plotoutline")

    @property
    def plots_field(self):
        return self.driver.find_element_by_name("plots")

    @property
    def text_languages_0_field(self):
        return self.driver.find_element_by_id("text_languages_0")

    @property
    def subtitles_field(self):
        return self.driver.find_element_by_name("subtitles")

    @property
    def audio_field(self):
        return self.driver.find_element_by_name("audio")

    @property
    def video_field(self):
        return self.driver.find_element_by_name("video")

    @property
    def country_field(self):
        return self.driver.find_element_by_name("country")

    @property
    def genres_field(self):
        return self.driver.find_element_by_name("genres")

    @property
    def director_field(self):
        return self.driver.find_element_by_name("director")

    @property
    def writer_field(self):
        return self.driver.find_element_by_name("writer")

    @property
    def producer_field(self):
        return self.driver.find_element_by_name("producer")

    @property
    def music_field(self):
        return self.driver.find_element_by_name("music")

    @property
    def cast_field(self):
        return self.driver.find_element_by_name("cast")

    @property
    def save_button(self):
        return self.driver.find_element_by_id("submit")

    @property
    def is_this_page(self):
        return self.driver.find_element_by_id("imdbsearchform")
